invisible(sapply(list.files("code/analyze_data/R", full.names = TRUE), source))

CHART_FORMAT <- "pdf"

APPLICATIONS_DATA <- "data/Applicants2007.dta"

if (packageVersion("vroom") == "1.5.5") {
  library(vroom)
} else {
  stop("vroom version 1.5.5 is not installed. Install it first.")
}
if (packageVersion("tidyverse") == "1.3.1") {
  library(vroom)
} else {
  stop("tidyverse version 1.3.1 is not installed. Install it first.")
}
if (packageVersion("glue") == "1.4.2") {
  library(vroom)
} else {
  stop("glue version 1.4.2 is not installed. Install it first.")
}
if (packageVersion("broom") == "0.7.9") {
  library(vroom)
} else {
  stop("broom version 0.7.9 is not installed. Install it first.")
}
if (packageVersion("haven") == "2.4.3") {
  library(vroom)
} else {
  stop("haven version 2.4.3 is not installed. Install it first.")
}

RESULTS_FOLDER <- "results/"

mytheme <- function (base_size = 11, base_family = "", base_line_size = base_size/22,
                     base_rect_size = base_size/22) {
    theme_minimal(base_size = base_size, base_family = base_family,
                  base_line_size = base_line_size, base_rect_size = base_rect_size) %+replace%
        theme(
            panel.border = element_rect(fill = NA, colour = "grey20"),
            panel.grid = element_line(colour = "grey92"),
            panel.grid.minor = element_line(size = rel(0.5))
        )
}
theme_set(mytheme())